import java.util.Scanner;

public class Test10 {
    public static void main(String[] args) {
        wardrobeFinishing(16, 8, 4);
    }

    public static int wardrobeFinishing(int m, int n, int cnt) {
        int count = 0;
        for(int i = 0; i < m; i++) {
            for(int j = 0; j < n; j++) {
                if(digit(i) + digit(j) <= cnt) {
                    System.out.print(digit(i) + " " + digit(j) + "; ");
                    count++;
                }
            }
        }
        return count;
    }

    public static int digit(int num) {
        // if(num < 10) {
        //     return num;
        // }
        int sum = 0;
        while(num != 0) {
            sum += (num % 10);
            num /= 10;
        }
        return sum;
    }
}
